package com.yanxml.spring.history.v3.demo6_conditional_on.condition_on;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class ConditionOnBean implements Condition {
    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        boolean flag = conditionContext.getRegistry().containsBeanDefinition("UserService");
        return false;
    }
}
